package com.microframework.boot.auth.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import lombok.Data;

/**
 * 验证码配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "kaptcha")
public class KaptchaProperties {
    
    private TextProducer textproducer = new TextProducer();
    private Image image = new Image();
    private Background background = new Background();
    private String border;
    private Noise noise = new Noise();
    private Word word = new Word();
    
    @Data
    public static class TextProducer {
        private Char char_ = new Char();
        private Font font = new Font();
        
        @Data
        public static class Char {
            private String string;
            private Integer length;
            private Integer space;
        }
        
        @Data
        public static class Font {
            private String names;
            private Integer size;
            private String color;
        }
    }
    
    @Data
    public static class Image {
        private Integer width;
        private Integer height;
    }
    
    @Data
    public static class Background {
        private Clear clear = new Clear();
        
        @Data
        public static class Clear {
            private String from;
            private String to;
        }
    }
    
    @Data
    public static class Noise {
        private String impl;
        private String color;
    }
    
    @Data
    public static class Word {
        private String impl;
    }
} 